const express = require('express')
const route = express.Router()
const advModel = require('../db/model/advModel')
//引入权限校验中间件
const isLoginMiddle = require("../middleware/isLoginMiddle")


route.get('/getUpdateData', isLoginMiddle, async (req, res) => {
  const { _id } = req.query
  try {
    const findResult = await advModel.findOne({ _id })
    res.send({
      code: 10000,
      msg: "查询更新按钮所在广告数据成功",
      data: findResult
    })
  } catch (e) {
    res.send({
      code: 10001,
      msg: "查询更新按钮所在广告数据失败" + e.message,
      data: null
    })
  }


})

module.exports = route